package com.xlh.dto.courseTest;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
class StatisticsDetailsDTO {
    // 累计分数
    private Integer total;
    // 章节分数详情
    private List<ChapterScoreDTO> details;

    StatisticsDetailsDTO(List<ChapterScoreDTO> details) {
        this.details = details;
        this.total = details.stream().map(ChapterScoreDTO::getScore).reduce(0, Integer::sum);
    }
}
